
public enum animation{
    Idle,
    Walk,
    Run,
    Attack,
    Hurt,
    Dead
}

public class GameState{
    public int score;
    public int level;
    public animation animation;
    
    #region 保存全部数据
    public BaseStateMemento SaveGameState(){
        return new BaseStateMemento(this);
    }

    public void RecoverGameState(GameStateMemento gameStateMemento){
        score = gameStateMemento.score;
        level = gameStateMemento.level;
        animation = gameStateMemento.animation;
    }
    #endregion

    #region 保存部分数据
    public BaseStateMemento SaveBaseState(){
        return new BaseStateMemento(this);
    }

    public void RecoverBaseState(BaseStateMemento baseStateMemento){
        score = baseStateMemento.score;
        level = baseStateMemento.level;
    }
    #endregion
}